package com.xuhuan.example.example042;

import com.xuhuan.example.util.ExampleArrayUtils;

/**
 * @author: huan.xu
 * @create: 2023/11/13 18:24
 * @description:
 **/
public class Example042 {

    public static void main(String[] args) {
        String[] array = {"A", "B", "C", "D", "E"};
        System.out.println("反转前数组：");
        ExampleArrayUtils.printArray(array);

        String[] arraysAfter = new String[array.length];

        for (int i = 0; i < array.length; i++) {
            arraysAfter[i] = array[array.length - i - 1];
        }

        System.out.println();
        System.out.println("反转后数组：");
        ExampleArrayUtils.printArray(arraysAfter);

    }
}
